package games.tanchishe;

import common.frame.GameFrame;

import javax.swing.*;
import java.awt.*;
import java.util.Random;

public class Start {

    public static void start() {
        GameFrame gameFrame = new GameFrame("snake");
//        JPanel headerPanel = new HeaderPanel();
        GamePanel gamePanel = new GamePanel();
//        gameFrame.add(headerPanel);
        gameFrame.add(gamePanel);
        gameFrame.setLocationRelativeTo(null);
        gameFrame.setVisible(true);
//        headerPanel.setSize(gameFrame.getSize().width, 100);
        gamePanel.setSize(gameFrame.getSize().width, gameFrame.getSize().height);

        // 创建snake
        Snake snake = new Snake(Color.PINK);
        snake.setWidth(10);
        Data.snakeList.add(snake);
        // 创建food
        gamePanel.createFood();

//        headerPanel.repaint();
        gamePanel.repaint();
    }


}
